package com.itheima.utils;

import javax.servlet.http.Cookie;

public class CookieUtil {

    //传入一个cookie数组根据cookie的名字得到对应的cookie的值
    public static Cookie getCookieByName(Cookie[] cookies, String cookieName){
        for (Cookie cookie : cookies) {
            if(cookie.getName().equals(cookieName)){
                return cookie;
            }
        }
        return null;
    }
}
